﻿using System;
using RazakiSite.UserControls;

namespace RazakiSite.PagesPublic
{
    public partial class Login : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            base.SetDefaultFormControls(LgnUser.FindControl("LoginButton").UniqueID, LgnUser.FindControl("UserName").ClientID);

            var returnUrl = UtilitiesUI.GetSimpleQueryString<string>("ReturnUrl");

            if (!string.IsNullOrWhiteSpace(returnUrl) && returnUrl.Equals("/"))
                Response.Redirect("~/Default.aspx");
        }

        protected void LgnUser_LoginError(object sender, EventArgs e)
        {
            var InfError = (UCInfo)LgnUser.FindControl("InfError");

            InfError.Hide = false;
            InfError.Text = LgnUser.FailureText;
        }

        protected override void ConfigControls()
        {
            throw new NotImplementedException();
        }

    }
}